{% extends "common.html" %}
{% block css %}
<link href="/static/css/reset_menu.css" rel="stylesheet" type="text/css">
<link href="/static/css/style-static.css" rel="stylesheet" type="text/css">
<link href="/static/css/bootstrap.css" rel="stylesheet" type="text/css">
<script src="/static/js/artTemplate.js"></script>
 <script type="text/javascript" charset="utf-8" src="/static/js/ueditor.config.js"></script>
 <script type="text/javascript" charset="utf-8" src="/static/js/ueditor.all.min.js"> </script>
<style type="text/css">
  .blue{
    background:#31d2e7;
    color: white;
  }
  .laydate_box, .laydate_box * {
        box-sizing:content-box;
    }
</style>
<script src="/static/js/laydate.js"></script>
{% endblock %}
{% load i18n %}
{% block content %}

<!--------内容-------------->
<div class="edititem">
   {% include "companySide.html" %}
  <div class="enterprise">
    <form method="post" action="{% url "addJob" %}" id="pickupForm">

     <h2><span></span>{% trans "informantion" %}</h2>
     <div class="form-horizontal text-left">
      <div class="form-group">
        <label  class="col-sm-2 control-label">{% trans "release" %}{% trans "job" %}:</label>
        <div class="col-sm-4">
          <input type="text" class="form-control" name="jpName" value="{{jpName}}">
        </div>
      </div>



      <div class="form-group">
        <label  class="col-sm-2 control-label">{% trans "work address" %}:</label>
    
       <div class="col-sm-2 ">
  
  <a class="btn btn-default blue" id="wz">{% trans "use" %}{% trans "company" %}{% trans "location" %}</a>
    <input type="hidden" name="location" id="mr" value="">
        </div>


         


    </div>

    <div class="form-group hidden">
        <label class="col-sm-2 control-label"></label>
          <div class="col-sm-2">
         <select class="form-control" id="country" name="country">
          <option value="Japanese" {% if country == 'Japanese' %}selected="selected"{% endif %}>日本</option>
          <option value="china" {% if country == 'china' %}selected="selected"{% endif %}>中国</option>
        </select>


      </div>

      
        <div id="jjk"></div>

        

      </div>

      <div class="form-group hidden">
        <label class="col-sm-2 control-label"></label>
        <div class="col-sm-8">
          <input type="text" class="form-control" name="address" value="" placeholder="详细地址">
        </div>
      </div>

      <div class="form-group">
        <label class="col-sm-2 control-label">{% trans "nature" %}:</label>
        <div class="col-sm-9">
          <label class="col-sm-3">
          <input type="radio" name="type" value="1" checked="true"> 正社员
        </label>

         <label class="col-sm-3">
          <input type="radio" name="type" value="2"> 契约社员
        </label>
        {% trans "other employ status" %}
        </div>
     
      </div>


    <div class="form-group">
      <label  class="col-sm-2 control-label">{% trans "job" %}:</label>

       <div class="col-sm-2" id="">
       <select  class="form-control" id="zw">
        <option value="1">IT</option>
         <option value="2">医疗</option>
       </select>
       </div>
      <div class="col-sm-2"> 
       <select  name="classify" class="form-control">
       {% for x in classifyList.it %}
      <option value="{{x}}" {% if x == classify %}selected="selected"{% endif %}>{% trans x %}</option>
        {% endfor %}
      
       </select> 
       </div>
      
       <div class="col-sm-2 hidden">
       <select name="classify" class="form-control" disabled="disabled">
         {% for x in classifyList.medical %}
             <option value="{{x}}" {% if x == classify %}selected="selected"{% endif %}>{% trans x %}</option>
        {% endfor %}
     
       </select>  </div>

      </div>

      

      <div class="form-group">
   <label  class="col-sm-2 control-label">{% trans "Education" %}{% trans "demand" %}:</label>
        <div class="col-sm-2">  
          <select class="form-control" name="education">


<option value="1" {% if 1 == education %}selected="selected"{% endif %}>{% trans "junior college" %}{% trans "above" %}</option>
            <option value="2" {% if 2 == education %}selected="selected"{% endif %}>{% trans "undergraduate course" %}{% trans "above" %}</option>
            <option value="3" {% if 3 == education %}selected="selected"{% endif %}>{% trans "master" %}{% trans "above" %}</option>
            <option value="4" {% if 4 == education %}selected="selected"{% endif %}>{% trans "doctor" %}</option>

      <option value="5" {% if 5 == education %}selected="selected"{% endif %}>{% trans "unlimited" %}</option>
          </select>

         
        </div>
      </div>





      <div class="form-group">
        <label  class="col-sm-2 control-label">{% trans "monthlyPay" %}:</label>
         <div class="col-sm-6">


<a class="btn btn-default blue" id="bz">{% trans "standard" %}</a>

<a class="btn btn-default" id="fw">{% trans "Range" %}</a>
      </div>
      </div>

      

      <div class="form-group hidden">
    <label  class="col-sm-2 control-label" ></label>
        <div class="input-group col-sm-4" style="padding-left: 15px;">
          
  <input type="text" class=" form-control col-sm-2" name="sPay" value="{{sPay}}" disabled="disabled">
       
           <div class="input-group-addon">~</div>
       
    <input type="text" class="form-control col-sm-4" name="ePay" value="{{ePay}}" disabled="disabled" >
           <div class="input-group-addon">{% trans "ten thousand yen" %}</div>
      

        </div>


      </div>

        
        <div class="form-group">
    <label  class="col-sm-2 control-label" ></label>
        <div class="input-group col-sm-2" style="padding-left: 15px;">
          
         
       
          <input type="text" class="form-control" name="jpPayment" value="{{jpPayment}}" placeholder="25">
           <div class="input-group-addon">{% trans "ten thousand yen" %}</div>
      

        </div>


      </div>



    </div>
   
    <div class="form-horizontal">
      <div class="form-group">
    <label  class="col-sm-2 control-label">{% trans "number" %}:</label>
        <div class="col-sm-2">
          <input type="text" class="form-control" id="appName" name="num" value="{{num}}" placeholder="5">
        </div>
      </div>
      {% if id %}
      <input type="hidden" name="id" value="{{id}}">
      {% endif %}
 
      <div class="form-group">
        <label  class="col-sm-2 control-label">{% trans "workexperience" %}:</label>
        <!-- <div class="col-sm-2 input-group" style="padding-left: 15px;"> -->
        <div class="col-sm-2" style="padding-left: 15px;">
          <input type="text" class="form-control" name="year" value="{{year|default:''}}" placeholder="3">
          <!-- <div class="input-group-addon">以上</div> -->
        </div>
        <!-- placeholder="为空则经验不限" -->
      </div>


     <h2><span></span>{% trans "special" %}</h2>

      
    


    <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <div class="checkbox">
       

       

        
        
      {% for x in jobTag %}
            <label class="col-sm-3">
           
    <input type="checkbox" name="tag[]" value="{{x}}"  {% if x in tag %}  checked="checked"   {% endif %}>
     {% trans x %}
        
  
        </label>

        {% endfor %}
       

       
       

       
         
      </div>
    </div>
  </div>


 <!--  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <div class="checkbox">
        

       

        


         
      </div>
    </div>
  </div> -->
    
    <!-- <h2><span></span>补贴标签</h2> -->

    <!-- <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <div class="checkbox">
        

        <label class="col-sm-3">
          <input type="checkbox"> 交通补助
        </label>

         <label class="col-sm-3">
          <input type="checkbox"> 房租补贴
        </label>

         <label class="col-sm-3">
          <input type="checkbox"> 夜班补贴
        </label>


         <label class="col-sm-3">
          <input type="checkbox"> 产妇补贴
        </label>

    

         
      </div>
    </div>
  </div> -->

    <!-- <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <div class="checkbox">
        

      

         <label class="col-sm-3">
          <input type="checkbox"> 伤病补贴
        </label>

        <label class="col-sm-3">
          <input type="checkbox"> 喜事/丧事补贴
        </label>


        <label class="col-sm-3">
          <input type="checkbox"> 技术补贴
        </label> 


         
      </div>
    </div>
  </div> -->


    <h2>{% trans "job info" %}<span></span></h2> 

    <div class="form-group">
      <label  class="col-sm-2 control-label">{% trans "job background" %}:</label>
      <div class="col-sm-8">
 
     <script type="text/plain" id="myEditor" style="width:600px;height:500px;">
        {{jpBackground|safe}}
    </script>


     </div>
   </div>


   
  <script type="text/javascript">
        UE.getEditor('myEditor',{
            //这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
            toolbars:[[ 'Undo', 'Redo','Bold','test']],
            //focus时自动清空初始化时的内容
            allHtmlEnabled:false,
            autoClearinitialContent:false,
            textarea:'jpBackground',
            //关闭字数统计
            wordCount:true,
            //关闭elementPath
            elementPathEnabled:false,
            //默认的编辑区域高度
            initialFrameHeight:300
            //更多其他参数，请参考ueditor.config.js中的配置项
        })
    </script>


    <div class="form-group">
      <label  class="col-sm-2 control-label">{% trans "job content" %}:</label>
      <div class="col-sm-8">
       <script type="text/plain" id="jpResponsible" style="width:600px;height:500px;">
      {{jpResponsible|safe}}
       </script>

       
     </div>
   </div>

   <script type="text/javascript">
        UE.getEditor('jpResponsible',{
            //这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
            toolbars:[['Undo', 'Redo','Bold','test']],
            //focus时自动清空初始化时的内容
            allHtmlEnabled:false,
            autoClearinitialContent:false,
            textarea:'jpResponsible',
            //关闭字数统计
            wordCount:false,
            //关闭elementPath
            elementPathEnabled:false,
            //默认的编辑区域高度
            initialFrameHeight:300
            //更多其他参数，请参考ueditor.config.js中的配置项
        })
    </script>



   <div class="form-group">
    <label  class="col-sm-2 control-label">{% trans "job memo" %}:</label>
    <div class="col-sm-8">

     <script type="text/plain" id="jpDemand" style="width:600px;height:500px;">
        {{jpDemand|safe}}
    </script>

     
   </div>
 </div>
 <script type="text/javascript">
        UE.getEditor('jpDemand',{
            //这里可以选择自己需要的工具按钮名称,此处仅选择如下五个
            toolbars:[[ 'Undo', 'Redo','Bold','test']],
            //focus时自动清空初始化时的内容
            allHtmlEnabled:false,
            autoClearinitialContent:false,
            textarea:'jpDemand',
            //关闭字数统计
            wordCount:true,
            //关闭elementPath
            elementPathEnabled:false,
            //默认的编辑区域高度
            initialFrameHeight:300
            //更多其他参数，请参考ueditor.config.js中的配置项
        })
    </script>

 </div>

 
 {% csrf_token %}

<div class="form-group">
    <label  class="col-sm-2 control-label"></label>
    <div class="col-sm-8">
      <input class="btn btn-default blue col-sm-4"  type="submit" value="保存">

   </div>
 </div>

</form>
</div>

</div>              
<script type="text/javascript">
 
  $('#address').change(function(){
    if (this.value == 1){
      $('#jp').addClass('hidden').attr('disabled','disabled')
      $('#china').removeClass('hidden')
      $('#china select').attr('disabled',false)
    }
    else if (this.value == 2){
      $('#china').addClass('hidden').attr('disabled','disabled')
      $('#jp').removeClass('hidden')
      $('#jp select').attr('disabled',false)
    }

  })

  $('#zw').change(function(){
    if (this.value == 1){
  $(this).parent().next().removeClass('hidden')
  $(this).parent().next().next().addClass('hidden')
  $(this).parent().next().find('select').attr('disabled',false)
  $(this).parent().next().next().find('select').attr('disabled','disabled')
  

    }
    else{
      $(this).parent().next().next().removeClass('hidden')
      $(this).parent().next().addClass('hidden')
      $(this).parent().next().next().find('select').attr('disabled',false)
      $(this).parent().next().find('select').attr('disabled','disabled')
      
    }
   
  })

  $('#logo').change(function(){
    alert('sdffd')
  })

  $('#fw').click(function(){
  $(this).addClass('blue')
  $('#bz').removeClass('blue')
  $('#fw').parent().parent().next("div").removeClass('hidden')
  $('#fw').parent().parent().next("div").find('input').attr('disabled',false)
  $('#fw').parent().parent().nextAll("div:eq(1)").addClass('hidden')
  $('#fw').parent().parent().nextAll("div:eq(1)").find('input').attr('disabled','disabled')
  })

   $('#bz').click(function(){
  $(this).addClass('blue')
  $('#fw').removeClass('blue')
  $('#fw').parent().parent().next("div").addClass('hidden')
  $('#fw').parent().parent().next("div").find('input').attr('disabled','disabled')
  $('#fw').parent().parent().nextAll("div:eq(1)").removeClass('hidden')
  $('#fw').parent().parent().nextAll("div:eq(1)").find('input').attr('disabled',false)
  })


   
 $('#wz').toggle(
  function(){
      $(this).removeClass('blue');
      $('#wz').parents('.form-group').next('div').removeClass('hidden');
      $('#wz').parents('.form-group').next('div').find('select:not(#china select)').attr('disabled',false)
      $('#wz').parents('.form-group').next().next().removeClass('hidden');
      $('#wz').parents('.form-group').next().next().find('input').attr('disabled',false)

  },function(){
    $(this).addClass('blue');
    $('#wz').parents('.form-group').next('div').addClass('hidden');
    $('#wz').parents('.form-group').next('div').find('select').attr('disabled','disabled')
     $('#wz').parents('.form-group').next().next().addClass('hidden');
     $('#wz').parents('.form-group').next().next().find('input').attr('disabled','disabled')
  }
  )

{% if sPay %}
$('#fw').click()
{% else %}
$('#bz').click()
{% endif %}
{% if type %}
$('[name=type][value={{type}}]').attr('checked',true)
{% endif %}
</script>
<script type="text/javascript">
$(document).ready(function() {
    $('#pickupForm')
        .bootstrapValidator({
            message: 'This value is not valid',
            feedbackIcons: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            fields: {
                jpName: {
                    message: 'The postal code is not valid',
                    validators: {
                        notEmpty: {
                            message: '{% trans "release" %}{% trans "job" %}{% trans "is required and cannot be empty" %}'
                        },
                       
                      
                    }
                },
                 num: {
                    message: 'The name is not valid',
                    validators: {
                        notEmpty: {
                            message: '{% trans "number" %} {% trans "is required and cannot be empty" %}'
                        },
                         numeric: {
                          message: '{% trans "Only numbers are allowed" %}'
                        }
                        
                    }
                },
                 year: {
                    message: 'The name is not valid',
                    validators: {
                        notEmpty: {
                        message: '{% trans "workexperience" %} {% trans "is required and cannot be empty" %}'
                        },
                         numeric: {
                          message: '{% trans "Only numbers are allowed" %}'
                        }
                     
                    }
                },
               jpResponsible: {
                    message: 'The name is not valid',
                    validators: {
                        notEmpty: {
                            message: '{% trans "job content" %} {% trans "is required and cannot be empty" %}'
                        },
                     
                    }
                },
                jpDemand: {
                    message: 'The name is not valid',
                    validators: {
                        notEmpty: {
                            message: '{% trans "jpDemand" %} {% trans "is required and cannot be empty" %}'
                        },
                       
                     
                    }
                },
                 introduce: {
                    message: 'The name is not valid',
                    validators: {
                        notEmpty: {
                            message: '{% trans "introduce oneself" %} {% trans "is required and cannot be empty" %}'
                        },
                     
                    }
                }


            }
        })
      })
  </script>
  <script id="chinadom" type="text/html">
<div class="col-sm-2 " id="china">
          <select class="form-control" name="location" >
          {% for x,y in city.china.items %}
             <option value="{{x}}" {% if location == x %}selected="selected"{% endif %}>{{y}}</option>
          {% endfor %}
           
            
          </select>
        </div>
</script>
<script id="jpdom" type="text/html">

<div class="col-sm-2" id="jp">
    <select class="form-control " name="location">
     {% for x,y in city.japan.items %}
             <option value="{{x}}" {% if location == x %}selected="selected"{% endif %}>{{y}}</option>
          {% endfor %}
            
          </select>
   </div>
</script>

<script> 
 $('#country').on("change",function(){

    if (this.value == 'china'){
      var html = template('chinadom');
      $('#jjk').html(html);
      return
    }
    else if (this.value == 'Japanese'){
      var html = template('jpdom');
      $('#jjk').html(html);
      return
    }

  })
 



$(document).ready(function() {
   {% if country == 'china' %}
      var html = template('chinadom');
      $('#jjk').html(html);
      
   {% else %}
      var html = template('jpdom');
      $('#jjk').html(html);
      
  {% endif %}

   

})
</script>
{% endblock %}  
